﻿using System;
using System.Text;
using System.Collections;
using System.Xml;
using System.Data;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Resources;
using System.Reflection;
using System.Globalization;
using System.Threading;

using Telerik.WebControls;
using UFSoft.UBF.UI.WebControls;
using UFSoft.UBF.UI.Controls;
using UFSoft.UBF.Util.Log;
using UFSoft.UBF.Util.Globalization;

using UFSoft.UBF.UI.IView;
using UFSoft.UBF.UI.Engine;
using UFSoft.UBF.UI.MD.Runtime;
using UFSoft.UBF.UI.ActionProcess;
using UFSoft.UBF.UI.WebControls.ClientCallBack;
using UFIDA.U9.UI.PDHelper;
using System.Collections.Specialized;



/***********************************************************************************************
 * Form ID: 
 * UIFactory Auto Generator 
 ***********************************************************************************************/
namespace UFIDA.U9.Learn.ItemBListUIModel
{
    public partial class ItemBListUIFormWebPart
    {
        #region Custome eventBind
	
		private void DetailInfo_Click_Extend(object sender,EventArgs e)
        {
			this.Model.ClearErrorMessage();
			if (this.Model.ItemBE.FocusedRecord == null)
				throw new Exception("请选择一行");

            //弹出自定义画面,并传入参数
            ItemBERecord record = this.Model.ItemBE.FocusedRecord;
			NameValueCollection param = new NameValueCollection();
			foreach(var field in this.Model.ItemBE.Fields)
            {
				if (record[field] == null) continue;
				param.Add(field.Name,record[field].ToString());
            }
			//this.ShowModalDialog("2432ff77-a33d-4a9c-8960-7f58b16f8e06", "详细信息", "580", "408", param);
			this.ShowAtlasModalDialog("2432ff77-a33d-4a9c-8960-7f58b16f8e06", "详细信息", "580", "408", null, param, false, true, false);
			DetailInfo_Click_DefaultImpl(sender,e);
		}
				//BtnNew_Click...
		private void BtnNew_Click_Extend(object sender, EventArgs  e)
		{
			//调用模版提供的默认实现.--默认实现可能会调用相应的Action.

			NavigateManager.NavigatePage(this, "UFIDA.U9.Learn.ItemUI");
			BtnNew_Click_DefaultImpl(sender,e);
		}	
		 
				//BtnDelete_Click...
		private void BtnDelete_Click_Extend(object sender, EventArgs  e)
		{
			//调用模版提供的默认实现.--默认实现可能会调用相应的Action.
			
		
			BtnDelete_Click_DefaultImpl(sender,e);
		}	
		 
				//BtnOutPut_Click...
		private void BtnOutPut_Click_Extend(object sender, EventArgs  e)
		{
			//调用模版提供的默认实现.--默认实现可能会调用相应的Action.
			
		
			BtnOutPut_Click_DefaultImpl(sender,e);
		}	
		 
				//BtnPrint_Click...
		private void BtnPrint_Click_Extend(object sender, EventArgs  e)
		{
			//调用模版提供的默认实现.--默认实现可能会调用相应的Action.
			
		
			BtnPrint_Click_DefaultImpl(sender,e);
		}	
		 

			

		//DDLCase_TextChanged...
		private void DDLCase_TextChanged_Extend(object sender, EventArgs  e)
		{
			//调用模版提供的默认实现.--默认实现可能会调用相应的Action.
			
		
			DDLCase_TextChanged_DefaultImpl(sender,e);
		}	
		 
				//OnLookCase_Click...
		private void OnLookCase_Click_Extend(object sender, EventArgs  e)
		{
			//调用模版提供的默认实现.--默认实现可能会调用相应的Action.

			

			OnLookCase_Click_DefaultImpl(sender,e);
		}

		private void OnNavigatCard(string type, string dataID, string formID)
		{
			string FormID = formID;//AddFormID
			string DataID = dataID;             
			if (DataID == String.Empty && type == "Browse")             
			{                 
				return;             
			}             
			else             
			{                 
				System.Collections.Specialized.NameValueCollection nameValCol = new System.Collections.Specialized.NameValueCollection();                 
				nameValCol.Add("PDPageStatus", type);                 
				nameValCol.Add("ID", DataID);                 
				this.NavigatePage(FormID, nameValCol);             
			}         
		}



		//DataGrid1_GridRowDbClicked...
		private void DataGrid1_GridRowDbClicked_Extend(object sender, GridDBClickEventArgs e)
		{
			//调用模版提供的默认实现.--默认实现可能会调用相应的Action.

			//通过this.CurrentModel.ViewName访问到记录的MainID字段，一定是MainID
			string DataID = this.Model.ItemBE.FocusedRecord["MainID"].ToString();
			//单据页面装配的URI
			string CardPageID = "UFIDA.U9.Learn.ItemUI";
			OnNavigatCard("Browse", DataID, CardPageID);

			DataGrid1_GridRowDbClicked_DefaultImpl(sender, e);
		}

		
            
            
            

		#region 自定义数据初始化加载和数据收集
		private void OnLoadData_Extend(object sender)
		{	
			OnLoadData_DefaultImpl(sender);
		}
		private void OnDataCollect_Extend(object sender)
		{	
			OnDataCollect_DefaultImpl(sender);
		}
		#endregion  

        #region 自己扩展 Extended Event handler 
		public void AfterOnLoad()
		{
			
			AfterOnLoad_Qry_DefaultImpl();//BE列表自动产生的代码
	    
		}

        public void AfterCreateChildControls()
        {
									
			AfterCreateChildControls_Qry_DefaultImpl();//BE列表自动产生的代码
		

		
        }
        
        public void AfterEventBind()
        {
        }
        
		public void BeforeUIModelBinding()
		{
								
		}

		public void AfterUIModelBinding()
		{
									
			AfterUIModelBinding_Qry_DefaultImpl();//BE列表自动产生的代码
		

		}


        #endregion
		
        #endregion
		
    }
}